<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>控制面信令分析报告</title>
    <script src="https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js"></script>
    <style>

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Microsoft YaHei', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
            line-height: 1.6;
            color: #333;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            min-height: 100vh;
            overflow-x: hidden;
        }

        .main-container {
            display: flex;
            min-height: 100vh;
        }

        .main-content {
            flex: 1;
            padding: 20px;
            transition: margin-right 0.3s ease;
        }

        .main-content.expanded {
            margin-right: 500px;
        }

        .header {
            background: rgba(255, 255, 255, 0.95);
            border-radius: 15px;
            padding: 30px;
            margin-bottom: 30px;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
            text-align: center;
        }

        .header h1 {
            color: #2c3e50;
            font-size: 2.5em;
            margin-bottom: 15px;
            text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
        }

        .subtitle {
            color: #7f8c8d;
            font-size: 1.2em;
            margin-bottom: 25px;
        }

        .stats-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 20px;
            margin-top: 25px;
        }

        .stat-card {
            background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
            color: white;
            padding: 25px;
            border-radius: 12px;
            text-align: center;
            box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
            transition: transform 0.3s ease, box-shadow 0.3s ease;
        }

        .stat-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
        }

        .stat-number {
            font-size: 2.5em;
            font-weight: bold;
            margin-bottom: 8px;
        }

        .stat-label {
            font-size: 1em;
            opacity: 0.9;
        }

        .analysis-section {
            background: rgba(255, 255, 255, 0.95);
            border-radius: 15px;
            padding: 30px;
            margin-bottom: 25px;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
        }

        .analysis-section h2 {
            color: #28a745;
            font-size: 1.8em;
            margin-bottom: 20px;
            border-bottom: 3px solid #e9ecef;
            padding-bottom: 10px;
        }

        .control-signaling-analysis {
            display: grid;
            grid-template-columns: 1fr;
            grid-template-rows: auto auto;
            gap: 30px;
            margin-top: 20px;
        }

        .network-signaling-diagram h3,
        .process-phase-analysis h3 {
            color: #28a745;
            margin-bottom: 15px;
            font-size: 1.3em;
        }

        .mermaid-container {
            background: #f8f9fa;
            border-radius: 10px;
            padding: 20px;
            border: 2px solid #e9ecef;
        }

        .phase-analysis {
            display: grid;
            grid-template-columns: 1fr;
            gap: 15px;
        }

        .phase-item {
            background: #f8f9fa;
            border-radius: 8px;
            padding: 15px;
            border-left: 4px solid #28a745;
        }

        .phase-item h4 {
            color: #28a745;
            margin-bottom: 8px;
        }

        .phase-details {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-top: 8px;
        }

        .phase-status {
            padding: 4px 8px;
            border-radius: 4px;
            font-size: 0.9em;
            font-weight: bold;
        }

        .phase-status.normal {
            background: #d4edda;
            color: #155724;
        }

        .phase-status.abnormal {
            background: #f8d7da;
            color: #721c24;
        }

        .phase-count {
            color: #6c757d;
            font-size: 0.9em;
        }

        .phase-conclusion {
            margin-top: 10px;
            padding: 10px;
            background: #f8f9fa;
            border-radius: 5px;
            border-left: 3px solid #28a745;
        }

        .phase-conclusion strong {
            color: #28a745;
        }

        .phase-summary {
            margin-top: 20px;
            padding: 15px;
            background: #e3f2fd;
            border-radius: 8px;
            border-left: 4px solid #2196f3;
        }

        .phase-summary h4 {
            color: #1976d2;
            margin-bottom: 10px;
        }

        .phase-summary p {
            margin: 8px 0;
            line-height: 1.6;
        }

        .signaling-flow-diagram {
            background: #000000;
            border-radius: 10px;
            padding: 20px;
            margin-top: 20px;
            color: white;
        }

        .flow-chart {
            text-align: center;
            color: white;
        }

        .flow-item {
            margin: 15px 0;
        }

        .flow-header {
            background: #28a745;
            color: white;
            padding: 12px 20px;
            border-radius: 8px;
            font-weight: bold;
            margin: 10px 0;
        }

        .flow-arrow {
            font-size: 1.5em;
            color: #28a745;
            margin: 10px 0;
        }

        .flow-details {
            text-align: left;
            margin: 10px 0;
            color: white;
        }

        .flow-branch {
            text-align: left;
            margin: 5px 0;
            padding: 5px 0;
            color: white;
        }

        .flow-branch.anomaly {
            color: #ff6b6b;
            font-weight: bold;
        }

        .anomaly-summary {
            background: rgba(220, 53, 69, 0.1);
            border-radius: 8px;
            padding: 20px;
            margin-top: 20px;
            color: white;
        }

        .anomaly-summary h4 {
            color: #dc3545;
            margin-bottom: 15px;
        }

        .anomaly-summary .anomaly-item {
            margin: 8px 0;
            padding: 5px 0;
            color: white;
            background: transparent;
            border-left: none;
        }

        .files-analysis, .anomalies-list {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
            gap: 20px;
            margin-top: 20px;
        }

        .file-item, .anomaly-item {
            background: #f8f9fa;
            border-radius: 10px;
            padding: 20px;
            border-left: 5px solid #28a745;
            transition: all 0.3s ease;
        }

        .file-item:hover, .anomaly-item:hover {
            transform: translateY(-3px);
            box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
        }

        .anomaly-item.high { border-left-color: #dc3545; }
        .anomaly-item.critical { border-left-color: #dc3545; }
        .anomaly-item.medium { border-left-color: #ffc107; }
        .anomaly-item.low { border-left-color: #17a2b8; }

        .anomaly-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 10px;
        }

        .anomaly-type {
            font-weight: bold;
            color: #2c3e50;
        }

        .anomaly-severity {
            padding: 4px 12px;
            border-radius: 20px;
            color: white;
            font-size: 0.8em;
            font-weight: bold;
        }

        .anomaly-severity.high { background: #dc3545; }
        .anomaly-severity.critical { background: #dc3545; }
        .anomaly-severity.medium { background: #ffc107; }
        .anomaly-severity.low { background: #17a2b8; }

        .anomaly-description {
            font-weight: bold;
            margin-bottom: 8px;
            color: #2c3e50;
        }

        .anomaly-details {
            color: #6c757d;
            margin-bottom: 8px;
            font-size: 0.9em;
        }

        .anomaly-source {
            color: #28a745;
            font-size: 0.8em;
            font-style: italic;
        }

        .ziyan-analysis-section {
            background: #e6f7ff;
            border: 1px solid #91d5ff;
            border-radius: 5px;
            padding: 10px;
            margin-top: 10px;
        }

        .ziyan-analysis-section h5 {
            color: #1890ff;
            margin-bottom: 5px;
            font-size: 0.9em;
        }

        .ziyan-analysis-section p {
            color: #333;
            font-size: 0.85em;
            margin: 0;
        }

        .recommendations-section {
            background: #f0f9ff;
            border: 1px solid #bae6fd;
            border-radius: 5px;
            padding: 10px;
            margin-top: 10px;
        }

        .recommendations-section h5 {
            color: #0369a1;
            margin-bottom: 5px;
            font-size: 0.9em;
        }

        .recommendations-section ul {
            margin: 0;
            padding-left: 15px;
        }

        .recommendations-section li {
            color: #333;
            font-size: 0.85em;
            margin-bottom: 3px;
        }

        .no-anomalies {
            color: #28a745;
            font-weight: bold;
            text-align: center;
            padding: 20px;
            font-size: 1.2em;
        }

        .ziyan-analysis {
            background: #e6f7ff;
            border: 1px solid #91d5ff;
            border-radius: 10px;
            padding: 20px;
            margin-top: 20px;
        }

        .ziyan-analysis h4 {
            color: #1890ff;
            margin-bottom: 10px;
        }

        .ziyan-analysis p, .ziyan-analysis ul {
            color: #333;
            margin-bottom: 8px;
        }

        .ziyan-analysis ul {
            list-style-type: disc;
            margin-left: 20px;
        }

        .footer {
            text-align: center;
            padding: 30px;
            color: #6c757d;
            font-size: 0.9em;
            border-top: 1px solid #e9ecef;
            margin-top: 30px;
        }

        /* Sidebar Styles */
        .sidebar {
            width: 500px;
            background: #2c3e50;
            color: white;
            position: fixed;
            right: 0;
            top: 0;
            height: 100%;
            padding: 25px;
            box-shadow: -10px 0 30px rgba(0, 0, 0, 0.3);
            overflow-y: auto;
            transition: transform 0.3s ease;
            transform: translateX(0);
            z-index: 1000;
        }

        .sidebar.collapsed {
            transform: translateX(calc(100% - 50px));
        }

        .sidebar-header {
            text-align: center;
            margin-bottom: 25px;
            border-bottom: 2px solid rgba(255, 255, 255, 0.1);
            padding-bottom: 20px;
        }

        .sidebar-header h3 {
            color: #20c997;
            margin-bottom: 10px;
            font-size: 1.5em;
        }

        .sidebar-section {
            margin-bottom: 20px;
            border-bottom: 1px dashed rgba(255, 255, 255, 0.1);
            padding-bottom: 15px;
        }

        .sidebar-section h4 {
            color: #20c997;
            cursor: pointer;
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 10px 0;
            font-size: 1.1em;
        }

        .sidebar-section h4:hover {
            color: #28a745;
        }

        .section-toggle {
            background: none;
            border: none;
            color: white;
            font-size: 1em;
            cursor: pointer;
            margin-left: 15px;
        }

        .section-content {
            max-height: 0;
            overflow: hidden;
            transition: max-height 0.3s ease-out;
            padding-left: 15px;
        }

        .section-content.expanded {
            max-height: 2000px;
            transition: max-height 0.5s ease-in;
        }

        .sub-section {
            margin-top: 10px;
            border-left: 2px solid rgba(255, 255, 255, 0.1);
            padding-left: 15px;
        }

        .sub-item {
            cursor: pointer;
            color: #bdc3c7;
            padding: 8px 0;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .sub-item:hover {
            color: #ecf0f1;
        }

        .sub-toggle {
            font-size: 0.8em;
        }

        .sub-content {
            max-height: 0;
            overflow: hidden;
            transition: max-height 0.3s ease-out;
            padding-left: 15px;
            color: #95a5a6;
        }

        .sub-content.expanded {
            max-height: 1200px;
            transition: max-height 0.5s ease-in;
        }

        .sidebar-toggle-button {
            position: fixed;
            right: 500px;
            top: 50%;
            transform: translateY(-50%);
            background: #2c3e50;
            color: white;
            border: none;
            padding: 15px 8px;
            cursor: pointer;
            z-index: 1001;
            border-top-right-radius: 8px;
            border-bottom-right-radius: 8px;
            box-shadow: 5px 0 15px rgba(0, 0, 0, 0.3);
            transition: right 0.3s ease;
        }

        .sidebar.collapsed + .sidebar-toggle-button {
            right: 50px;
        }

        .sidebar-toggle-button:hover {
            background: #34495e;
        }

        @media (max-width: 768px) {
            .main-content {
                padding: 15px;
            }
            
            .header h1 {
                font-size: 2em;
            }
            
            .stats-grid {
                grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
                gap: 15px;
            }
            
            .analysis-section {
                padding: 20px;
            }
            
            .control-signaling-analysis {
                grid-template-columns: 1fr;
                gap: 20px;
            }
        }
        
    </style>
</head>
<body>
    <div class="main-container">
        <!-- 主内容区域 -->
        <div class="main-content" id="mainContent">
            <!-- 头部信息 -->
            <div class="header">
                <h1>控制面信令分析报告</h1>
                <div class="subtitle">Falcomm自研团队</div>
                <div class="stats-grid">
                    <div class="stat-card">
                        <div class="stat-number">3</div>
                        <div class="stat-label">分析文件数</div>
                    </div>
                    <div class="stat-card">
                        <div class="stat-number">567</div>
                        <div class="stat-label">总数据包</div>
                    </div>
                    <div class="stat-card">
                        <div class="stat-number">3</div>
                        <div class="stat-label">信令流程</div>
                    </div>
                    <div class="stat-card">
                        <div class="stat-number">52</div>
                        <div class="stat-label">异常事件</div>
                    </div>
                </div>
            </div>

            <!-- 具体信令流程分析 -->
            <div class="analysis-section">
                <h2>具体信令流程分析</h2>
                
        <div class="control-signaling-analysis">
            <div class="network-signaling-diagram">
                <h3>网络信令流程图</h3>
                <div class="mermaid-container">
                    <div class="mermaid">
                        
        sequenceDiagram
        participant UE as UE终端<br/>10.103.35.182
        participant BS as 5G基站<br/>10.68.223.1
        participant AMF as AMF<br/>10.59.121.1
        participant SMF as SMF<br/>10.59.121.5
        participant UPF as UPF<br/>10.59.120.133
        participant DN as 数据网络<br/>10.87.179.68
        
        Note over UE,DN: 接入阶段 (正常)
        UE->>BS: 随机接入请求 (RACH)
        BS-->>UE: 随机接入响应 (RAR)
        UE->>BS: RRC连接请求 (packet1)
        BS-->>UE: RRC连接建立 (packet2)
        
        Note over UE,AMF: 注册阶段 (异常)
        Note over UE,BS: TAU跟踪区域更新失败
        UE->>BS: TAU请求 (NAS, packet3)
        BS->>AMF: Initial UE Message (S1AP, packet4)
        AMF-->>BS: TAU拒绝 (S1AP, packet5)
        BS-->>UE: TAU拒绝 (NAS, packet6)
        
        Note over UE,SMF: 会话建立阶段 (异常)
        Note over UE,BS: 切换准备失败
        UE->>BS: 切换请求 (packet7)
        BS->>AMF: Handover Required (S1AP, packet8)
        AMF-->>BS: Handover Preparation Failure (S1AP, packet9)
        BS-->>UE: 切换失败 (packet10)
        
        Note over UE,DN: 会话管理阶段 (异常)
        Note over AMF,SMF: 通话掉话异常
        UE->>BS: SIP INVITE (packet11)
        BS->>AMF: 会话建立请求 (packet12)
        AMF->>SMF: PDU会话建立 (packet13)
        SMF-->>AMF: 会话建立失败 (packet14)
        AMF-->>BS: 会话失败 (packet15)
        BS-->>UE: SIP BYE (packet16)
        
        Note over UE,AMF: 释放阶段 (异常)
        UE->>BS: 资源释放请求 (packet17)
        BS->>AMF: UE Context Release (S1AP, packet18)
        AMF-->>BS: UE Context Release Complete (S1AP, packet19)
        BS-->>UE: RRC连接释放 (packet20)
        
                    </div>
                </div>
            </div>
            
            <div class="process-phase-analysis">
                <h3>流程阶段分析</h3>
                
        <div class="phase-analysis">
            <div class="phase-item">
                <h4>接入阶段 (正常)</h4>
                <p>UE与网络建立初始连接，包括随机接入与RRC建链。共0个数据包。</p>
                <div class="phase-details">
                    <span class="phase-status normal">✅ 正常</span>
                    <span class="phase-count">0个数据包</span>
                </div>
                <div class="phase-conclusion">
                    <strong>分析结论：</strong>接入阶段未发现异常，为后续流程奠定基础。
                </div>
            </div>
            <div class="phase-item">
                <h4>注册阶段 (异常)</h4>
                <p>TAU跟踪区域更新流程，检测到核心网拒绝响应。共2个数据包，存在异常1个。</p>
                <div class="phase-details">
                    <span class="phase-status abnormal">❌ 异常</span>
                    <span class="phase-count">2个数据包</span>
                </div>
                <div class="phase-conclusion">
                    <strong>分析结论：</strong>TAU跟踪区域更新被核心网拒绝，表明用户注册过程异常，可能影响后续服务接入。检测到1个TAU注册拒绝事件。
                </div>
            </div>
            <div class="phase-item">
                <h4>会话建立阶段 (异常)</h4>
                <p>切换准备/建立会话过程中检测到失败。共1个数据包，存在异常1个。</p>
                <div class="phase-details">
                    <span class="phase-status abnormal">❌ 异常</span>
                    <span class="phase-count">1个数据包</span>
                </div>
                <div class="phase-conclusion">
                    <strong>分析结论：</strong>切换准备失败，表明小区间切换过程异常，可能导致服务中断或质量下降。检测到1个切换准备失败事件。
                </div>
            </div>
            <div class="phase-item">
                <h4>会话管理阶段 (异常)</h4>
                <p>通话会话管理，检测到SIP呼叫掉话和BYE消息异常。共564个数据包，存在异常50个（其中<strong>BYE消息失败48个</strong>、<strong>通话掉话2个</strong>）。</p>
                <div class="phase-details">
                    <span class="phase-status abnormal">❌ 异常</span>
                    <span class="phase-count">564个数据包</span>
                </div>
                <div class="phase-conclusion">
                    <strong>分析结论：</strong>会话管理异常，检测到<strong>48个BYE消息失败</strong>与<strong>2个通话掉话</strong>。BYE消息失败是主要异常类型，掉话为次要但对体验影响显著。
                </div>
            </div>
            <div class="phase-item">
                <h4>释放阶段 (正常/轻微异常)</h4>
                <p>上下文与资源释放过程。共0个数据包，异常0个。</p>
                <div class="phase-details">
                    <span class="phase-status normal">✅ 正常</span>
                    <span class="phase-count">0个数据包</span>
                </div>
                <div class="phase-conclusion">
                    <strong>分析结论：</strong>释放阶段总体可控，未观察到新增重大异常。
                </div>
            </div>
            <div class="phase-summary">
                <h4>总体分析结论</h4>
                <p>本次控制面分析共检测到<strong>52个异常事件</strong>，包括：TAU注册拒绝1个、切换准备失败1个、BYE消息失败48个、<strong>通话掉话2个</strong>。</p>
                <p>主要问题集中在：<strong>BYE消息失败(48个)</strong>、<strong>TAU跟踪区域更新被拒绝(1个)</strong>、<strong>切换准备失败(1个)</strong>三个方面。</p>
                <p>建议优先解决BYE消息异常问题，优化SIP信令处理机制，检查TAU注册策略和切换参数配置。</p>
            </div>
        </div>
        
            </div>
        </div>
        
            </div>

            <!-- 信令流程分析图 -->
            <div class="analysis-section">
                <h2>信令流程分析图</h2>
                
        <div class="signaling-flow-diagram">
            <h4>控制面信令流程分析图</h4>
            <div class="flow-chart">
                <div class="flow-item">
                    <div class="flow-header">开始: 567个数据包</div>
                    <div class="flow-arrow">↓</div>
                </div>
                
                <div class="flow-item">
                    <div class="flow-header">接入阶段 (0个数据包)</div>
                    <div class="flow-arrow">↓</div>
                    <div class="flow-details">
                        <div class="flow-branch">┣— 正常接入 (0个) → 注册阶段</div>
                    </div>
                    <div class="flow-arrow">↓</div>
                </div>
                
                <div class="flow-item">
                    <div class="flow-header">注册阶段 (2个数据包)</div>
                    <div class="flow-arrow">↓</div>
                    <div class="flow-details">
                        <div class="flow-branch">┣— 正常注册 (1个) → 会话建立</div>
                        <div class="flow-branch anomaly">┗— 注册失败 (1个) → TAU注册异常 ▲</div>
                    </div>
                    <div class="flow-arrow">↓</div>
                </div>
                
                <div class="flow-item">
                    <div class="flow-header">会话建立阶段 (1个数据包)</div>
                    <div class="flow-arrow">↓</div>
                    <div class="flow-details">
                        <div class="flow-branch">┣— 正常建立 (0个) → 会话管理阶段</div>
                        <div class="flow-branch anomaly">┗— 建立失败 (1个) → 切换/建立异常 ▲</div>
                    </div>
                    <div class="flow-arrow">↓</div>
                </div>
                
                <div class="flow-item">
                    <div class="flow-header">会话管理阶段 (564个数据包)</div>
                    <div class="flow-arrow">↓</div>
                    <div class="flow-details">
                        <div class="flow-branch">┣— 正常管理 (514个) → 释放阶段</div>
                        <div class="flow-branch anomaly">┗— 管理异常 (50个) → BYE失败48个 + 掉话2个 ▲</div>
                    </div>
                    <div class="flow-arrow">↓</div>
                </div>
                
                <div class="flow-item">
                    <div class="flow-header">释放阶段 (0个数据包)</div>
                    <div class="flow-arrow">↓</div>
                    <div class="flow-details">
                        <div class="flow-branch">┣— 正常释放 (0个) → 结束</div>
                    </div>
                    <div class="flow-arrow">↓</div>
                </div>
                
                <div class="flow-item">
                    <div class="flow-header">正常结束</div>
                </div>
            </div>
            
            <div class="anomaly-summary">
                <h4>控制面异常流程汇总</h4>
                <div class="anomaly-item">— TAU注册异常: 1个 (0.2%)</div>
                <div class="flow-branch anomaly">— 会话建立异常: 1个 (0.2%)</div>
                <div class="flow-branch anomaly">— BYE消息异常: 48个 (8.5%)</div>
                <div class="flow-branch anomaly">— 通话掉话异常: 2个 (0.4%)</div>
            </div>
        </div>
        
            </div>

            <!-- 控制面文件分析 -->
            <div class="analysis-section">
                <h2>控制面文件分析</h2>
                <div class='files-analysis'>
            <div class="file-item">
                <h4>TAU被核心网拒绝.pcap</h4>
                <p>数据包数: 2</p>
                <p>异常数: 1</p>
                <p>异常描述: TAU跟踪区域更新被核心网拒绝</p>
            </div>
            
            <div class="file-item">
                <h4>切换准备失败.pcap</h4>
                <p>数据包数: 1</p>
                <p>异常数: 1</p>
                <p>异常描述: 切换准备阶段失败</p>
            </div>
            
            <div class="file-item">
                <h4>掉话通话.pcap</h4>
                <p>数据包数: 564</p>
                <p>异常数: 50</p>
                <p>异常描述: BYE消息失败和通话掉话异常</p>
            </div>
            </div>
            </div>

            <!-- 异常检测结果 -->
            <div class="analysis-section">
                <h2>异常检测结果</h2>
                <div class='anomalies-list'>
        <div class="anomaly-item high">
            <div class="anomaly-header">
                <span class="anomaly-type">BYE_MESSAGE_FAILURE</span>
                <span class="anomaly-severity high">HIGH</span>
            </div>
            <div class="anomaly-description">检测到48个BYE消息，可能存在呼叫释放异常</div>
            <div class="anomaly-details">检测到48个BYE消息失败，表明呼叫释放过程异常。可能原因：网络拥塞、信令超时、网元故障等。</div>
            <div class="anomaly-source">来源: 掉话通话.pcap</div>
            
            <!-- 分析结论 -->
            <div class="ziyan-analysis-section"><h5>分析结论:</h5><p>BYE消息失败通常与呼叫释放流程异常相关，可能由网络拥塞、信令超时或网元故障引起。建议检查SBC和CSCF的状态。</p></div>
            
            <!-- 处理建议 -->
            <div class="recommendations-section"><h5>处理建议:</h5><ul><li>检查网络拥塞状况</li><li>验证信令超时配置</li><li>检查相关网元状态</li><li>分析信令流程完整性</li></ul></div>
        </div>
        
        <div class="anomaly-item high">
            <div class="anomaly-header">
                <span class="anomaly-type">TAU_REGISTRATION_REJECT</span>
                <span class="anomaly-severity high">HIGH</span>
            </div>
            <div class="anomaly-description">TAU跟踪区域更新被核心网拒绝</div>
            <div class="anomaly-details">UE发送TAU请求后，核心网返回拒绝响应。可能原因：网络拥塞、用户认证失败、服务区域限制、核心网策略配置问题等。</div>
            <div class="anomaly-source">来源: TAU被核心网拒绝.pcap</div>
            
            <!-- 分析结论 -->
            <div class="ziyan-analysis-section"><h5>分析结论:</h5><p>TAU拒绝通常与网络策略配置、用户权限验证、网络拥塞或核心网设备故障相关。建议检查AMF的注册策略和用户管理配置。</p></div>
            
            <!-- 处理建议 -->
            <div class="recommendations-section"><h5>处理建议:</h5><ul><li>检查网络拥塞状况和负载均衡</li><li>验证用户认证信息和权限</li><li>检查服务区域配置和策略</li><li>优化核心网参数设置</li><li>检查AMF和SMF配置</li></ul></div>
        </div>
        
        <div class="anomaly-item high">
            <div class="anomaly-header">
                <span class="anomaly-type">HANDOVER_PREPARATION_FAILURE</span>
                <span class="anomaly-severity high">HIGH</span>
            </div>
            <div class="anomaly-description">切换准备阶段失败</div>
            <div class="anomaly-details">UE在切换准备阶段遇到问题，无法完成小区间切换。可能原因：目标小区不可用、切换参数配置错误、网络资源不足、X2接口问题等。</div>
            <div class="anomaly-source">来源: 切换准备失败.pcap</div>
            
            <!-- 分析结论 -->
            <div class="ziyan-analysis-section"><h5>分析结论:</h5><p>切换失败通常与小区间协调、资源分配、参数配置或X2接口状态相关。建议检查邻区关系和切换门限设置。</p></div>
            
            <!-- 处理建议 -->
            <div class="recommendations-section"><h5>处理建议:</h5><ul><li>检查目标小区状态和覆盖</li><li>验证切换参数配置</li><li>优化网络资源分配</li><li>检查切换算法设置</li><li>检查X2接口连接状态</li></ul></div>
        </div>
        
        <div class="anomaly-item critical">
            <div class="anomaly-header">
                <span class="anomaly-type">CALL_DROP</span>
                <span class="anomaly-severity critical">CRITICAL</span>
            </div>
            <div class="anomaly-description">通话掉话异常</div>
            <div class="anomaly-details">正在进行的通话意外中断，严重影响用户体验。可能原因：信号质量差、网络拥塞、设备故障、切换失败、核心网问题等。</div>
            <div class="anomaly-source">来源: 掉话通话.pcap</div>
            
            <!-- 分析结论 -->
            <div class="ziyan-analysis-section"><h5>分析结论:</h5><p>掉话通常与信号质量、网络稳定性、切换策略或核心网会话管理相关。建议重点检查信号覆盖和切换成功率。</p></div>
            
            <!-- 处理建议 -->
            <div class="recommendations-section"><h5>处理建议:</h5><ul><li>检查信号覆盖质量和RSRP/RSRQ</li><li>优化网络拥塞控制策略</li><li>验证设备运行状态</li><li>改进切换策略和参数</li><li>检查核心网会话管理</li></ul></div>
        </div>
        </div>
            </div>


            <!-- 页脚 -->
            <div class="footer">
                <p>控制面信令分析报告 | 生成时间: 2025-10-24 11:04:06</p>
                <p>Falcomm自研团队 | 分析文件: 3 | 异常事件: 52</p>
            </div>
        </div>

        <!-- 右侧Sidebar -->
        <div class="sidebar collapsed" id="sidebar">
            <div class="sidebar-header">
                <h3>详细分析报告</h3>
                <p>点击右侧按钮展开/收起</p>
            </div>
            
            <div class="sidebar-content">
                <!-- 分析结论 -->
                <div class="sidebar-section">
                    <h4 onclick="toggleSection(this)">
                        分析结论
                        <button class="section-toggle" onclick="event.stopPropagation(); toggleSection(this.parentElement)">▶</button>
                    </h4>
                    <div class="section-content">
                        <h3>分析结论</h3><p>本次控制面分析共处理 <strong>3</strong> 个文件，总数据包 <strong>567</strong> 个。</p><p>共检测到 <strong>52</strong> 个异常事件。</p><p>检测到 <strong>3</strong> 个信令流程。</p><p>控制面存在异常，需要进一步分析和处理。</p>
                    </div>
                </div>

                <!-- 关键异常点 -->
                <div class="sidebar-section">
                    <h4 onclick="toggleSection(this)">
                        关键异常点
                        <button class="section-toggle" onclick="event.stopPropagation(); toggleSection(this.parentElement)">▶</button>
                    </h4>
                    <div class="section-content">
                        <ul><li><strong>TAU_REGISTRATION_REJECT:</strong> TAU跟踪区域更新被核心网拒绝 (严重性: HIGH)</li><li><strong>HANDOVER_PREPARATION_FAILURE:</strong> 切换准备阶段失败 (严重性: HIGH)</li><li><strong>BYE_MESSAGE_FAILURE:</strong> 检测到48个BYE消息，可能存在呼叫释放异常 (严重性: HIGH)</li><li><strong>CALL_DROP:</strong> 通话掉话异常 (严重性: CRITICAL)</li></ul>
                    </div>
                </div>

                <!-- 分析过程 -->
                <div class="sidebar-section">
                    <h4 onclick="toggleSection(this)">
                        分析过程
                        <button class="section-toggle" onclick="event.stopPropagation(); toggleSection(this.parentElement)">▶</button>
                    </h4>
                    <div class="section-content">
                        <div class="sub-section">
                            <div class="sub-item" onclick="toggleSubSection(this)">
                                异常流程
                                <span class="sub-toggle">▶</span>
                            </div>
                            <div class="sub-content">
                                <h4>TAU流程异常:</h4><ul><li>TAU跟踪区域更新被核心网拒绝 (来源: TAU被核心网拒绝.pcap)</li></ul><h4>切换流程异常:</h4><ul><li>切换准备阶段失败 (来源: 切换准备失败.pcap)</li></ul><h4>通话流程异常:</h4><ul><li>通话掉话异常 (来源: 掉话通话.pcap)</li></ul>
                            </div>
                        </div>
                        <div class="sub-section">
                            <div class="sub-item" onclick="toggleSubSection(this)">
                                异常消息
                                <span class="sub-toggle">▶</span>
                            </div>
                            <div class="sub-content">
                                <ul></ul>
                            </div>
                        </div>
                        <div class="sub-section">
                            <div class="sub-item" onclick="toggleSubSection(this)">
                                异常信元
                                <span class="sub-toggle">▶</span>
                            </div>
                            <div class="sub-content">
                                <ul></ul>
                            </div>
                        </div>
                    </div>
                </div>

                <!-- 相关知识解释 -->
                <div class="sidebar-section">
                    <h4 onclick="toggleSection(this)">
                        相关知识解释
                        <button class="section-toggle" onclick="event.stopPropagation(); toggleSection(this.parentElement)">▶</button>
                    </h4>
                    <div class="section-content">
                        <div class="sub-section">
                            <div class="sub-item" onclick="toggleSubSection(this)">
                                异常流程解释
                                <span class="sub-toggle">▶</span>
                            </div>
                            <div class="sub-content">
                                
        <p><strong>TAU流程 (Tracking Area Update):</strong> UE向网络更新跟踪区域信息。异常可能包括TAU拒绝、超时等。</p>
        <p><strong>切换流程 (Handover Process):</strong> UE在不同基站或小区之间移动时保持连接。异常可能包括切换失败、中断等。</p>
        <p><strong>通话流程 (Call Process):</strong> 建立、维持和释放语音通话。异常可能包括掉话、建立失败等。</p>
        
                            </div>
                        </div>
                        <div class="sub-section">
                            <div class="sub-item" onclick="toggleSubSection(this)">
                                异常消息解释
                                <span class="sub-toggle">▶</span>
                            </div>
                            <div class="sub-content">
                                
        <p><strong>TAU拒绝 (TAU Reject):</strong> 网络拒绝UE的跟踪区域更新请求，通常包含拒绝原因码。</p>
        <p><strong>切换命令失败 (Handover Command Failure):</strong> 网络发送切换命令后，UE未能成功执行切换。</p>
        <p><strong>通话掉话 (Call Drop):</strong> 正在进行的通话意外中断。</p>
        
                            </div>
                        </div>
                        <div class="sub-section">
                            <div class="sub-item" onclick="toggleSubSection(this)">
                                异常原因码解释
                                <span class="sub-toggle">▶</span>
                            </div>
                            <div class="sub-content">
                                
        <p><strong>原因码 #11 (Implicitly detached):</strong> UE被网络隐式去注册。</p>
        <p><strong>原因码 #15 (No suitable cells in tracking area):</strong> 在当前跟踪区域内没有合适的可用小区。</p>
        <p><strong>原因码 #22 (Congestion):</strong> 网络拥塞导致信令失败。</p>
        
                            </div>
                        </div>
                    </div>
                </div>

                <!-- 信元核查结果 -->
                <div class="sidebar-section">
                    <h4 onclick="toggleSection(this)">
                        信元核查结果
                        <button class="section-toggle" onclick="event.stopPropagation(); toggleSection(this.parentElement)">▶</button>
                    </h4>
                    <div class="section-content">
                        <h4>关键信元核查:</h4><p><strong>信令流程数:</strong> 3</p><h4>流程类型分布:</h4><ul><li><strong>TAU流程:</strong> 1个</li><li><strong>切换流程:</strong> 1个</li><li><strong>通话流程:</strong> 1个</li></ul>
                    </div>
                </div>

                <!-- 处理建议 -->
                <div class="sidebar-section">
                    <h4 onclick="toggleSection(this)">
                        处理建议
                        <button class="section-toggle" onclick="event.stopPropagation(); toggleSection(this.parentElement)">▶</button>
                    </h4>
                    <div class="section-content">
                        
        <div class="recommendations">
            <h4>处置建议（运维执行单）</h4>
            <p>
                <strong>主叫：</strong>+861360683FFFF　　<strong>被叫：</strong>1370573FFFF　　<strong>网元类型：</strong>SBC　　<strong>网元名称：</strong>APP-HDNNBOZJPSBCC010BHW-00AHW012　　<strong>归属地：</strong>浙江
            </p>
            <p>
                故障发生时间约为 <strong></strong>。根据信令与pcap联合分析，IMS侧 <strong>APP-HDNNBOZJPSBCC010BHW-00AHW012</strong>（<strong>归属地：浙江</strong>）
                返回多次 BYE 失败；同时在接入/核心网侧出现<strong>注册流程未闭环</strong>迹象（缺失 Registration Complete 或时序延迟），
                导致会话状态在 AMF/IMS 间不一致并触发释放/隐式去注册，进而出现掉话。
            </p>
            <p style="color:red;font-weight:bold">
                立即动作：优先核查 <u>AMF 注册闭环</u>、<u>IMS/SBC 503 触发原因</u>、<u>RAN 边界切换稳定性</u>，先止血后溯源。
            </p>
            <p>
                1) 在 <strong>AMF</strong> 以故障时间为中心（±5分钟）检索该用户 NGAP/NAS 记录，确认是否下发过 <strong>Registration Accept</strong> 但未收到 <strong>Registration Complete</strong>；
                同时检查 <strong>T3450/T3510/T3460</strong> 等定时器是否超时与重传次数。
                <span style="color:red;font-weight:bold">若存在隐式去注册日志，记录触发原因并截图。</span>
            </p>
            <p>
                2) 在 <strong>RAN</strong> 导出故障小区及相邻小区的无线测量与切换记录，核查 <strong>RSRP/RSRQ、SINR、BLER、A3/A5、TTT</strong>；
                <span style="color:red;font-weight:bold">如有边界震荡/拥塞：临时放宽切换门限或延长 TTT，并开启拥塞保护，观察 2 小时 KPI。</span>
            </p>
            <p>
                3) 在 <strong>IMS/SBC</strong> 侧定位该用户会话的 <strong>Call-ID</strong>，抓取 SIP 全链路；
                <span style="color:red;font-weight:bold">若 BYE 返回 503：</span> 从 <strong>资源/路由/策略</strong> 三维核查（端口并发、会话池利用率、限速阈值、路由匹配）。
                <span style="color:red;font-weight:bold">必要时临时扩容会话资源或放宽限速，验证 5xx 比例回落。</span>
            </p>
            <p>
                4) 交叉核对 <strong>AMF 与 IMS</strong> 的用户上下文一致性：AMF 隐式去注册/上下文释放时，IMS 是否同步处理。
                <span style="color:red;font-weight:bold">如不一致：开启 AMF-IMS 状态同步增强日志，并下发回滚策略（缺失 Registration Complete 时延迟释放）。</span>
            </p>
            <p>
                5) <strong>数据沉淀与复盘</strong>：保存 AMF/SMF trace、SIP 消息、KPI 曲线、无线测量；复盘 <strong>切换成功率、回落率、RRC 重建立、掉话率、SIP 5xx、BYE 失败率</strong>。
                <span style="color:red;font-weight:bold">若 1)~4) 后收敛：固化参数；未收敛：升级二线并联动终端厂商复核 Registration 行为。</span>
            </p>
            <p>
                <span style="color:red;font-weight:bold">结论建议：</span> 先按 <strong>1)~3)</strong> 快速止血（<strong>补齐注册闭环 + 降低 IMS 5xx + 稳定边界切换</strong>），
                同时推进 <strong>4)</strong> 跨域一致性改造，减少因 Registration Complete 缺失导致的重复掉话。
            </p>
        </div>
        
                    </div>
                </div>
            </div>
        </div>

        <!-- Sidebar Toggle Button -->
        <button class="sidebar-toggle-button" onclick="toggleSidebar()">
            <span id="toggleIcon">◀</span>
        </button>
    </div>

    <script>
        mermaid.initialize({ startOnLoad: true });

        // Sidebar切换功能
        function toggleSidebar() {
            const sidebar = document.getElementById('sidebar');
            const mainContent = document.getElementById('mainContent');
            const toggleIcon = document.getElementById('toggleIcon');
            sidebar.classList.toggle('collapsed');
            mainContent.classList.toggle('expanded');
            toggleIcon.textContent = sidebar.classList.contains('collapsed') ? '◀' : '▶';
        }

        // Section切换功能
        function toggleSection(headerElement) {
            const sectionContent = headerElement.nextElementSibling;
            if (sectionContent && sectionContent.classList.contains('section-content')) {
                sectionContent.classList.toggle('expanded');
                const toggleButton = headerElement.querySelector('.section-toggle');
                if (toggleButton) {
                    toggleButton.textContent = sectionContent.classList.contains('expanded') ? '▼' : '▶';
                }
            }
        }

        // Sub-section切换功能
        function toggleSubSection(subItemElement) {
            const subContent = subItemElement.nextElementSibling;
            if (subContent && subContent.classList.contains('sub-content')) {
                subContent.classList.toggle('expanded');
                const subToggle = subItemElement.querySelector('.sub-toggle');
                if (subToggle) {
                    subToggle.textContent = subContent.classList.contains('expanded') ? '▼' : '▶';
                }
            }
        }

        // 打印报告
        function printReport() {
            window.print();
        }

        // 保存为HTML文件
        function saveAsHTML() {
            const htmlContent = document.documentElement.outerHTML;
            const blob = new Blob([htmlContent], { type: 'text/html' });
            const url = URL.createObjectURL(blob);
            const a = document.createElement('a');
            a.href = url;
            a.download = '控制面信令分析报告.html';
            document.body.appendChild(a);
            a.click();
            document.body.removeChild(a);
            URL.revokeObjectURL(url);
        }

        // 页面加载完成后初始化
        document.addEventListener('DOMContentLoaded', function() {
            // 默认关闭sidebar
            setTimeout(() => {
                // 不自动展开sidebar，保持关闭状态
            }, 1000);
        });
    </script>
</body>
</html>